package com.ruoyi.camp.api;

import com.ruoyi.camp.domain.CCampsite;
import com.ruoyi.camp.service.ICCampsiteService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/wechat/campsite")
public class WxCampsiteController  extends BaseController {

    @Autowired
    private ICCampsiteService cCampsiteService;

    @GetMapping("/list")
    public AjaxResult list(CCampsite cCampsite)
    {
        startPage();
        List<CCampsite> list = cCampsiteService.selectCCampsiteList(cCampsite);
        return success(list);
    }

    /**
     * 新增campsite
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody CCampsite cCampsite)
    {
        return success(cCampsiteService.insertCCampsite(cCampsite));
    }
}
